home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / IntlResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  13.1 KB  |  379 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        IntlResources.h
  3.  
  4.      Contains:    International Resource definitions.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1983-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __INTLRESOURCES__
  19. #define __INTLRESOURCES__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47.  
  48. enum {
  49.                                                                 /* Bits in the itlcFlags byte */
  50.     itlcShowIcon                = 7,                            /*Show icon even if only one script*/
  51.     itlcDualCaret                = 6,                            /*Use dual caret for mixed direction text*/
  52.                                                                 /* Bits in the itlcSysFlags word */
  53.     itlcSysDirection            = 15                            /*System direction - left to right/right to left*/
  54. };
  55.  
  56.  
  57.  
  58. enum {
  59.     tokLeftQuote                = 1,                            /* NumberParts.data[] enumerators                                             */
  60.     tokRightQuote                = 2,                            /*  In general, these are NOT to be considered indices into the data[] array */
  61.     tokLeadPlacer                = 3,
  62.     tokLeader                    = 4,
  63.     tokNonLeader                = 5,
  64.     tokZeroLead                    = 6,
  65.     tokPercent                    = 7,
  66.     tokPlusSign                    = 8,
  67.     tokMinusSign                = 9,
  68.     tokThousands                = 10,
  69.     tokReserved                    = 11,                            /* 11 is reserved field */
  70.     tokSeparator                = 12,
  71.     tokEscape                    = 13,
  72.     tokDecPoint                    = 14,
  73.     tokEPlus                    = 15,
  74.     tokEMinus                    = 16,
  75.     tokMaxSymbols                = 31,
  76.     curNumberPartsVersion        = 1                                /*current version of NumberParts record*/
  77. };
  78.  
  79.  
  80. enum {
  81.     currSymLead                    = 16,
  82.     currNegSym                    = 32,
  83.     currTrailingZ                = 64,
  84.     currLeadingZ                = 128
  85. };
  86.  
  87.  
  88. enum {
  89.     mdy                            = 0,
  90.     dmy                            = 1,
  91.     ymd                            = 2,
  92.     myd                            = 3,
  93.     dym                            = 4,
  94.     ydm                            = 5
  95. };
  96.  
  97. typedef SInt8                             DateOrders;
  98.  
  99. enum {
  100.     timeCycle24                    = 0,                            /*time sequence 0:00 - 23:59*/
  101.     timeCycleZero                = 1,                            /*time sequence 0:00-11:59, 0:00 - 11:59*/
  102.     timeCycle12                    = 255,                            /*time sequence 12:00 - 11:59, 12:00 - 11:59*/
  103.     zeroCycle                    = 1,                            /*old name for timeCycleZero*/
  104.     longDay                        = 0,                            /*day of the month*/
  105.     longWeek                    = 1,                            /*day of the week*/
  106.     longMonth                    = 2,                            /*month of the year*/
  107.     longYear                    = 3,                            /*year*/
  108.     supDay                        = 1,                            /*suppress day of month*/
  109.     supWeek                        = 2,                            /*suppress day of week*/
  110.     supMonth                    = 4,                            /*suppress month*/
  111.     supYear                        = 8,                            /*suppress year*/
  112.     dayLdingZ                    = 32,
  113.     mntLdingZ                    = 64,
  114.     century                        = 128,
  115.     secLeadingZ                    = 32,
  116.     minLeadingZ                    = 64,
  117.     hrLeadingZ                    = 128
  118. };
  119.  
  120. /* move OffsetTable to QuickdrawText */
  121. struct Intl0Rec {
  122.     char                             decimalPt;                    /*decimal point character*/
  123.     char                             thousSep;                    /*thousands separator character*/
  124.     char                             listSep;                    /*list separator character*/
  125.     char                             currSym1;                    /*currency symbol*/
  126.     char                             currSym2;
  127.     char                             currSym3;
  128.     UInt8                             currFmt;                    /*currency format flags*/
  129.     UInt8                             dateOrder;                    /*order of short date elements: mdy, dmy, etc.*/
  130.     UInt8                             shrtDateFmt;                /*format flags for each short date element*/
  131.     char                             dateSep;                    /*date separator character*/
  132.     UInt8                             timeCycle;                    /*specifies time cycle: 0..23, 1..12, or 0..11*/
  133.     UInt8                             timeFmt;                    /*format flags for each time element*/
  134.     char                             mornStr[4];                    /*trailing string for AM if 12-hour cycle*/
  135.     char                             eveStr[4];                    /*trailing string for PM if 12-hour cycle*/
  136.     char                             timeSep;                    /*time separator character*/
  137.     char                             time1Suff;                    /*trailing string for AM if 24-hour cycle*/
  138.     char                             time2Suff;
  139.     char                             time3Suff;
  140.     char                             time4Suff;
  141.     char                             time5Suff;                    /*trailing string for PM if 24-hour cycle*/
  142.     char                             time6Suff;
  143.     char                             time7Suff;
  144.     char                             time8Suff;
  145.     UInt8                             metricSys;                    /*255 if metric, 0 if inches etc.*/
  146.     short                             intl0Vers;                    /*region code (hi byte) and version (lo byte)*/
  147. };
  148. typedef struct Intl0Rec Intl0Rec;
  149.  
  150. typedef Intl0Rec *                        Intl0Ptr;
  151. typedef Intl0Ptr *                        Intl0Hndl;
  152. struct Intl1Rec {
  153.     Str15                             days[7];                    /*day names*/
  154.     Str15                             months[12];                    /*month names*/
  155.     UInt8                             suppressDay;                /*255 for no day, or flags to suppress any element*/
  156.     UInt8                             lngDateFmt;                    /*order of long date elements*/
  157.     UInt8                             dayLeading0;                /*255 for leading 0 in day number*/
  158.     UInt8                             abbrLen;                    /*length for abbreviating names*/
  159.     char                             st0[4];                        /*separator strings for long date format*/
  160.     char                             st1[4];
  161.     char                             st2[4];
  162.     char                             st3[4];
  163.     char                             st4[4];
  164.     short                             intl1Vers;                    /*region code (hi byte) and version (lo byte)*/
  165.     short                             localRtn[1];                /*now a flag for opt extension*/
  166. };
  167. typedef struct Intl1Rec Intl1Rec;
  168.  
  169. typedef Intl1Rec *                        Intl1Ptr;
  170. typedef Intl1Ptr *                        Intl1Hndl;
  171. /*fields for optional itl1 extension*/
  172. struct Itl1ExtRec {
  173.     Intl1Rec                         base;                        /*un-extended Intl1Rec*/
  174.     short                             version;
  175.     short                             format;
  176.     short                             calendarCode;                /*calendar code for this itl1 resource*/
  177.     long                             extraDaysTableOffset;        /*offset in itl1 to extra days table*/
  178.     long                             extraDaysTableLength;        /*length of extra days table*/
  179.     long                             extraMonthsTableOffset;        /*offset in itl1 to extra months table*/
  180.     long                             extraMonthsTableLength;        /*length of extra months table*/
  181.     long                             abbrevDaysTableOffset;        /*offset in itl1 to abbrev days table*/
  182.     long                             abbrevDaysTableLength;        /*length of abbrev days table*/
  183.     long                             abbrevMonthsTableOffset;    /*offset in itl1 to abbrev months table*/
  184.     long                             abbrevMonthsTableLength;    /*length of abbrev months table*/
  185.     long                             extraSepsTableOffset;        /*offset in itl1 to extra seps table*/
  186.     long                             extraSepsTableLength;        /*length of extra seps table*/
  187.     short                             tables[1];                    /*now a flag for opt extension*/
  188. };
  189. typedef struct Itl1ExtRec Itl1ExtRec;
  190.  
  191. struct UntokenTable {
  192.     short                             len;
  193.     short                             lastToken;
  194.     short                             index[256];                    /*index table; last = lastToken*/
  195. };
  196. typedef struct UntokenTable UntokenTable;
  197.  
  198. typedef UntokenTable *                    UntokenTablePtr;
  199. typedef UntokenTablePtr *                UntokenTableHandle;
  200. union WideChar {
  201.     char                             a[2];                        /*0 is the high order character*/
  202.     short                             b;
  203. };
  204. typedef union WideChar WideChar;
  205.  
  206. struct WideCharArr {
  207.     short                             size;
  208.     WideChar                         data[10];
  209. };
  210. typedef struct WideCharArr WideCharArr;
  211.  
  212. struct NumberParts {
  213.     short                             version;
  214.     WideChar                         data[31];                    /*index by [tokLeftQuote..tokMaxSymbols]*/
  215.     WideCharArr                     pePlus;
  216.     WideCharArr                     peMinus;
  217.     WideCharArr                     peMinusPlus;
  218.     WideCharArr                     altNumTable;
  219.     char                             reserved[20];
  220. };
  221. typedef struct NumberParts NumberParts;
  222.  
  223. typedef NumberParts *                    NumberPartsPtr;
  224.  
  225. struct Itl4Rec {
  226.     short                             flags;                        /*reserved*/
  227.     long                             resourceType;                /*contains 'itl4'*/
  228.     short                             resourceNum;                /*resource ID*/
  229.     short                             version;                    /*version number*/
  230.     long                             resHeader1;                    /*reserved*/
  231.     long                             resHeader2;                    /*reserved*/
  232.     short                             numTables;                    /*number of tables, one-based*/
  233.     long                             mapOffset;                    /*offset to table that maps byte to token*/
  234.     long                             strOffset;                    /*offset to routine that copies canonical string*/
  235.     long                             fetchOffset;                /*offset to routine that gets next byte of character*/
  236.     long                             unTokenOffset;                /*offset to table that maps token to canonical string*/
  237.     long                             defPartsOffset;                /*offset to default number parts table*/
  238.     long                             resOffset6;                    /*reserved*/
  239.     long                             resOffset7;                    /*reserved*/
  240.     long                             resOffset8;                    /*reserved*/
  241. };
  242. typedef struct Itl4Rec Itl4Rec;
  243.  
  244. typedef Itl4Rec *                        Itl4Ptr;
  245. typedef Itl4Ptr *                        Itl4Handle;
  246. /* New NItl4Rec for System 7.0: */
  247. struct NItl4Rec {
  248.     short                             flags;                        /*reserved*/
  249.     long                             resourceType;                /*contains 'itl4'*/
  250.     short                             resourceNum;                /*resource ID*/
  251.     short                             version;                    /*version number*/
  252.     short                             format;                        /*format code*/
  253.     short                             resHeader;                    /*reserved*/
  254.     long                             resHeader2;                    /*reserved*/
  255.     short                             numTables;                    /*number of tables, one-based*/
  256.     long                             mapOffset;                    /*offset to table that maps byte to token*/
  257.     long                             strOffset;                    /*offset to routine that copies canonical string*/
  258.     long                             fetchOffset;                /*offset to routine that gets next byte of character*/
  259.     long                             unTokenOffset;                /*offset to table that maps token to canonical string*/
  260.     long                             defPartsOffset;                /*offset to default number parts table*/
  261.     long                             whtSpListOffset;            /*offset to white space code list*/
  262.     long                             resOffset7;                    /*reserved*/
  263.     long                             resOffset8;                    /*reserved*/
  264.     short                             resLength1;                    /*reserved*/
  265.     short                             resLength2;                    /*reserved*/
  266.     short                             resLength3;                    /*reserved*/
  267.     short                             unTokenLength;                /*length of untoken table*/
  268.     short                             defPartsLength;                /*length of default number parts table*/
  269.     short                             whtSpListLength;            /*length of white space code list*/
  270.     short                             resLength7;                    /*reserved*/
  271.     short                             resLength8;                    /*reserved*/
  272. };
  273. typedef struct NItl4Rec NItl4Rec;
  274.  
  275. typedef NItl4Rec *                        NItl4Ptr;
  276. typedef NItl4Ptr *                        NItl4Handle;
  277.  
  278. struct TableDirectoryRecord {
  279.     OSType                             tableSignature;                /*4 byte long table name */
  280.     unsigned long                     reserved;                    /*Reserved for internal use */
  281.     unsigned long                     tableStartOffset;            /*Table start offset in byte*/
  282.     unsigned long                     tableSize;                    /*Table size in byte*/
  283. };
  284. typedef struct TableDirectoryRecord TableDirectoryRecord;
  285.  
  286. struct Itl5Record {
  287.     Fixed                             versionNumber;                /*itl5 resource version number */
  288.     unsigned short                     numberOfTables;                /*Number of tables it contains */
  289.     unsigned short                     reserved[3];                /*Reserved for internal use */
  290.     TableDirectoryRecord             tableDirectory[1];            /*Table directory records */
  291. };
  292. typedef struct Itl5Record Itl5Record;
  293.  
  294. struct RuleBasedTrslRecord {
  295.     short                             sourceType;                    /*Transliterate target type for the LHS of the rule */
  296.     short                             targetType;                    /*Transliterate target type for the RHS of the rule */
  297.     short                             formatNumber;                /*Transliterate resource format number */
  298.     short                             propertyFlag;                /*Transliterate property flags */
  299.     short                             numberOfRules;                /*Number of rules following this field */
  300. };
  301. typedef struct RuleBasedTrslRecord RuleBasedTrslRecord;
  302.  
  303.  
  304. struct ItlcRecord {
  305.     short                             itlcSystem;                    /*default system script*/
  306.     short                             itlcReserved;                /*reserved*/
  307.     SInt8                             itlcFontForce;                /*default font force flag*/
  308.     SInt8                             itlcIntlForce;                /*default intl force flag*/
  309.     SInt8                             itlcOldKybd;                /*MacPlus intl keybd flag*/
  310.     SInt8                             itlcFlags;                    /*general flags*/
  311.     short                             itlcIconOffset;                /*keyboard icon offset; not used in 7.0*/
  312.     SInt8                             itlcIconSide;                /*keyboard icon side; not used in 7.0*/
  313.     SInt8                             itlcIconRsvd;                /*rsvd for other icon info*/
  314.     short                             itlcRegionCode;                /*preferred verXxx code*/
  315.     short                             itlcSysFlags;                /*flags for setting system globals*/
  316.     SInt8                             itlcReserved4[32];            /*for future use*/
  317. };
  318. typedef struct ItlcRecord ItlcRecord;
  319.  
  320. struct ItlbRecord {
  321.     short                             itlbNumber;                    /*itl0 id number*/
  322.     short                             itlbDate;                    /*itl1 id number*/
  323.     short                             itlbSort;                    /*itl2 id number*/
  324.     short                             itlbFlags;                    /*Script flags*/
  325.     short                             itlbToken;                    /*itl4 id number*/
  326.     short                             itlbEncoding;                /*itl5 ID # (optional; char encoding)*/
  327.     short                             itlbLang;                    /*current language for script */
  328.     SInt8                             itlbNumRep;                    /*number representation code*/
  329.     SInt8                             itlbDateRep;                /*date representation code */
  330.     short                             itlbKeys;                    /*KCHR id number*/
  331.     short                             itlbIcon;                    /*ID # of SICN or kcs#/kcs4/kcs8 suite.*/
  332. };
  333. typedef struct ItlbRecord ItlbRecord;
  334.  
  335. /* New ItlbExtRecord structure for System 7.0 */
  336. struct ItlbExtRecord {
  337.     ItlbRecord                         base;                        /*un-extended ItlbRecord*/
  338.     long                             itlbLocalSize;                /*size of script's local record*/
  339.     short                             itlbMonoFond;                /*default monospace FOND ID*/
  340.     short                             itlbMonoSize;                /*default monospace font size*/
  341.     short                             itlbPrefFond;                /*preferred FOND ID*/
  342.     short                             itlbPrefSize;                /*preferred font size*/
  343.     short                             itlbSmallFond;                /*default small FOND ID*/
  344.     short                             itlbSmallSize;                /*default small font size*/
  345.     short                             itlbSysFond;                /*default system FOND ID*/
  346.     short                             itlbSysSize;                /*default system font size*/
  347.     short                             itlbAppFond;                /*default application FOND ID*/
  348.     short                             itlbAppSize;                /*default application font size*/
  349.     short                             itlbHelpFond;                /*default Help Mgr FOND ID*/
  350.     short                             itlbHelpSize;                /*default Help Mgr font size*/
  351.     Style                             itlbValidStyles;            /*set of valid styles for script*/
  352.     Style                             itlbAliasStyle;                /*style (set) to mark aliases*/
  353. };
  354. typedef struct ItlbExtRecord ItlbExtRecord;
  355.  
  356.  
  357.  
  358.  
  359. #if PRAGMA_STRUCT_ALIGN
  360.     #pragma options align=reset
  361. #elif PRAGMA_STRUCT_PACKPUSH
  362.     #pragma pack(pop)
  363. #elif PRAGMA_STRUCT_PACK
  364.     #pragma pack()
  365. #endif
  366.  
  367. #ifdef PRAGMA_IMPORT_OFF
  368. #pragma import off
  369. #elif PRAGMA_IMPORT
  370. #pragma import reset
  371. #endif
  372.  
  373. #ifdef __cplusplus
  374. }
  375. #endif
  376.  
  377. #endif /* __INTLRESOURCES__ */
  378.  
  379.